namespace MVCMult.Models
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;

    public partial class MemberModel : DbContext
    {
        public MemberModel()
            : base("name=MemberModels")
        {
        }

        public virtual DbSet<CardLevels> CardLevels { get; set; }
        public virtual DbSet<Categories> Categories { get; set; }
        public virtual DbSet<CategoryItems> CategoryItems { get; set; }
        public virtual DbSet<ConsumeOrders> ConsumeOrders { get; set; }
        public virtual DbSet<ExchangeGigts> ExchangeGigts { get; set; }
        public virtual DbSet<ExchangeLogs> ExchangeLogs { get; set; }
        public virtual DbSet<MenCard> MenCard { get; set; }
        public virtual DbSet<Shops> Shops { get; set; }
        public virtual DbSet<TransferLogs> TransferLogs { get; set; }
        public virtual DbSet<Users> Users { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<CardLevels>()
                .Property(e => e.CL_LevelName)
                .IsUnicode(false);

            modelBuilder.Entity<CardLevels>()
                .Property(e => e.CL_NeedPoint)
                .IsUnicode(false);

            modelBuilder.Entity<Categories>()
                .Property(e => e.C__Category)
                .IsUnicode(false);

            modelBuilder.Entity<Categories>()
                .Property(e => e.C_Illustration)
                .IsUnicode(false);

            modelBuilder.Entity<Categories>()
                .HasMany(e => e.CategoryItems)
                .WithOptional(e => e.Categories)
                .HasForeignKey(e => e.C_C__Category);

            modelBuilder.Entity<CategoryItems>()
                .Property(e => e.C_C__Category)
                .IsUnicode(false);

            modelBuilder.Entity<CategoryItems>()
                .Property(e => e.CL_Name)
                .IsUnicode(false);

            modelBuilder.Entity<ConsumeOrders>()
                .Property(e => e.CO_OrderCode)
                .IsUnicode(false);

            modelBuilder.Entity<ConsumeOrders>()
                .Property(e => e.CO_MC_CardID)
                .IsUnicode(false);

            modelBuilder.Entity<ConsumeOrders>()
                .Property(e => e.CO_Remark)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeGigts>()
                .Property(e => e.EG_GiftCode)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeGigts>()
                .Property(e => e.EG_GiftName)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeGigts>()
                .Property(e => e.EG_Photo)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeGigts>()
                .Property(e => e.EG_Remark)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeLogs>()
                .Property(e => e.EL_MC_CardID)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeLogs>()
                .Property(e => e.MC_Name)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeLogs>()
                .Property(e => e.EG_GiftGode)
                .IsUnicode(false);

            modelBuilder.Entity<ExchangeLogs>()
                .Property(e => e.EG_GiftName)
                .IsUnicode(false);

            modelBuilder.Entity<MenCard>()
                .Property(e => e.MC_CardID)
                .IsUnicode(false);

            modelBuilder.Entity<MenCard>()
                .Property(e => e.MC_Password)
                .IsUnicode(false);

            modelBuilder.Entity<MenCard>()
                .Property(e => e.MC_Name)
                .IsUnicode(false);

            modelBuilder.Entity<MenCard>()
                .Property(e => e.MC_Mobile)
                .IsUnicode(false);

            modelBuilder.Entity<MenCard>()
                .Property(e => e.MC_Photo)
                .IsUnicode(false);

            modelBuilder.Entity<MenCard>()
                .Property(e => e.MC_RefererCard)
                .IsUnicode(false);

            modelBuilder.Entity<Shops>()
                .Property(e => e.S_Name)
                .IsUnicode(false);

            modelBuilder.Entity<Shops>()
                .Property(e => e.S_ContactName)
                .IsUnicode(false);

            modelBuilder.Entity<Shops>()
                .Property(e => e.S_ContactTel)
                .IsUnicode(false);

            modelBuilder.Entity<Shops>()
                .Property(e => e.S_Address)
                .IsUnicode(false);

            modelBuilder.Entity<Shops>()
                .Property(e => e.S_Remark)
                .IsUnicode(false);

            modelBuilder.Entity<Shops>()
                .HasMany(e => e.Users)
                .WithOptional(e => e.Shops)
                .HasForeignKey(e => e.S_FKID);

            modelBuilder.Entity<TransferLogs>()
                .Property(e => e.TL_FormMC_CardID)
                .IsUnicode(false);

            modelBuilder.Entity<TransferLogs>()
                .Property(e => e.TL_MC_CardID)
                .IsUnicode(false);

            modelBuilder.Entity<TransferLogs>()
                .Property(e => e.TL_Remark)
                .IsUnicode(false);

            modelBuilder.Entity<Users>()
                .Property(e => e.U_LoginName)
                .IsUnicode(false);

            modelBuilder.Entity<Users>()
                .Property(e => e.U_Password)
                .IsUnicode(false);

            modelBuilder.Entity<Users>()
                .Property(e => e.U_RealName)
                .IsUnicode(false);

            modelBuilder.Entity<Users>()
                .Property(e => e.U_Sex)
                .IsUnicode(false);

            modelBuilder.Entity<Users>()
                .Property(e => e.U_Telephone)
                .IsUnicode(false);
        }
    }
}
